package main

import (
	"fmt"
	"unsafe"
)

func main() {

	var f1 float64 = 88.99
	fmt.Printf("f1 = %T  size = %d", f1, unsafe.Sizeof(f1))

	var num1 float32 = -0.000028
	var num2 float32 = -789456123.023

	fmt.Println("\n")
	//num1= -2.8e-05 num2= -7.894561e+08
	fmt.Println("num1=", num1, "num2=", num2)

	//精度丢失
	var num3 float32 = -123.0000901
	var num4 float64 = -123.0000901
	//num3= -123.00009 num4= -123.0000901
	fmt.Println("\nnum3=", num3, "num4=", num4)

	//小数默认是float64
	num5 := 0.1
	fmt.Printf("小数默认类型是 %T\n", num5)

	//
	num6 := .521
	fmt.Printf("num6=", num6)

	//科学计数法
	num7 := 5.212121e3
	num8 := 5.212121e-3

	fmt.Println("\nnum7=", num7, "\nnum8=", num8)

}
